<html xmlns="http://www.w3c.org/1999/xhtml"
	xmlns:h="http://java.sun.com/jsf/html"
	xmlns:f="http://java.sun.com/jsf/core"
	xmlns:p="http://primefaces.org/ui">
<h:head>

</h:head>
<h:body>
	<h:form id="form_agrarian_business_data">
	
		<p:commandButton value="#{i18n['cmpnt.new']}"
		    actionListener="#{agrarianBusinessController.createNewRegister}"
		    partialSubmit="true"
			styleClass="ui-flowbutton" update="form_agrarian_business_data" />
		<p:dataTable  id="a_table" var="register"
			value="#{aSession.agrarianResource.agrarianResourceRegisters}" emptyMessage="#{i18n['cmpnt.no.data']}">
			<p:column
				headerText="#{i18n['lbl.owner.agrarian_business_perspective.product']}">
				<p:selectOneMenu id="a_select" value="#{register.product}" onchange="setLabels(this);">
					<f:selectItem itemLabel="#{i18n['cmpnt.type_or_select']}"
						itemValue="" />
					<f:selectItems
						value="#{productAgrarianResourceCmb.parameterDTO.options}" />						
				</p:selectOneMenu>
			</p:column>
			<p:column
				headerText="#{i18n['lbl.owner.agrarian_business_perspective.variety']}">
				<p:inputText value="#{register.variety}" />
			</p:column>
			<p:column
				headerText="#{i18n['lbl.owner.agrarian_business_perspective.certified_seed']}">

				<p:selectOneMenu value="#{register.certifiedSeed}" >
					<f:selectItem itemLabel="#{i18n['cmpnt.select_one']}" itemValue="" />
					<f:selectItem itemLabel="#{i18n['cmpnt.yes']}" itemValue="1" />
					<f:selectItem itemLabel="#{i18n['cmpnt.not']}" itemValue="2" />
				</p:selectOneMenu>

			</p:column>
			<p:column styleClass="text-align-center"
				headerText="Area cosechada(ha)">
				<p:inputText styleClass="input-number ui-width-xxxs" value="#{register.harvestedArea}" />
			</p:column>
			
			<p:column styleClass="text-align-center"
				headerText="Producción Total (kilos/año) Semestre A">
				<p:inputText styleClass="input-number ui-width-xxxs" value="#{register.semesterA}" />

			</p:column>
			<p:column styleClass="text-align-center"
				headerText="Producción Total (kilos/año) Semestre B">
				<p:inputText styleClass="input-number ui-width-xxxs" value="#{register.semesterB}" />
			</p:column>
		</p:dataTable>

		<br />
		<br />
		<br />
		<p:dataTable id="b_table" var="register"
			value="#{aSession.agrarianResource.agrarianResourceRegisters}" emptyMessage="#{i18n['cmpnt.no.data']}">
			<p:column headerText="">
				<p:outputLabel id="b_label" styleClass="label-product"  value="#{register.productDesc}" />
			</p:column>			
			<p:column styleClass="text-align-center"
				headerText="#{i18n['lbl.owner.agrarian_business_perspective.establishment_costs']}">
				<p:inputText styleClass="input-number ui-width-s" value="#{register.establishmentCosts}" />
			</p:column>
			<p:column styleClass="text-align-center"
				headerText="#{i18n['lbl.owner.agrarian_business_perspective.sustenance_cost']}">
				<p:inputText styleClass="input-number ui-width-s" value="#{register.sustainingCosts}" />

			</p:column>
			<p:column styleClass="text-align-center"
				headerText="#{i18n['lbl.owner.agrarian_business_perspective.production_for_the_market']}">
				<p:inputText styleClass="input-number ui-width-s" value="#{register.productionForTheMarket}" />
			</p:column>
			<p:column
				headerText="#{i18n['lbl.owner.agrarian_business_perspective.site_for_sale']}">
				<p:selectOneMenu value="#{register.siteForSale}">
					<f:selectItem itemLabel="#{i18n['cmpnt.select_one']}" itemValue="" />
					<f:selectItems
						value="#{siteForSaleAgrarianResourceCmb.parameterDTO.options}" />
				</p:selectOneMenu>
			</p:column>
		</p:dataTable>
		<br />
		<br />
		<br />
		<p:dataTable id="c_table" var="register"
			value="#{aSession.agrarianResource.agrarianResourceRegisters}" emptyMessage="#{i18n['cmpnt.no.data']}">
			<p:column headerText="">
				<p:outputLabel id="c_label" styleClass="label-product"  value="#{register.productDesc}" />
			</p:column>
<!-- 			<p:column -->
<!-- 				headerText="#{i18n['lbl.owner.agrarian_business_perspective.sells_to']}"> -->
<!-- 				<p:inputText value="#{register.sellsToNameAndSurname}" /> -->
<!-- 			</p:column> -->
			<p:column
				headerText="#{i18n['lbl.owner.agrarian_business_perspective.sale_type']}">
				<p:selectOneMenu value="#{register.saleType}">
					<f:selectItem itemLabel="#{i18n['cmpnt.select_one']}" itemValue="" />
					<f:selectItems
						value="#{saleTypeForestResourceCmb.parameterDTO.options}" />
				</p:selectOneMenu>
			</p:column>
			<p:column
				headerText="#{i18n['lbl.owner.agrarian_business_perspective.sells_to_name_and_surname']}">
				<p:inputText value="#{register.sellsToNameAndSurname}" />
			</p:column>
			<p:column styleClass="text-align-center"
				headerText="#{i18n['lbl.owner.agrarian_business_perspective.average_sales_price']}">
				<p:inputText styleClass="input-number ui-width-s" value="#{register.salesPriceAverage}" />
			</p:column>
			<p:column
				headerText="#{i18n['lbl.owner.agrarian_business_perspective.method_of_payment']}">
				<p:selectOneMenu value="#{register.methodOfPayment}">
					<f:selectItem itemLabel="#{i18n['cmpnt.select_one']}" itemValue="" />
					<f:selectItems
						value="#{methodOfPaymentForestResourceCmb.parameterDTO.options}" />
				</p:selectOneMenu>
			</p:column>
		</p:dataTable>
		<br />
		<br />
		<br />
		<p:dataTable id="d_table" var="register"
			value="#{aSession.agrarianResource.agrarianResourceRegisters}" emptyMessage="#{i18n['cmpnt.no.data']}">
			<p:column headerText="">
				<p:outputLabel id="d_label" styleClass="label-product"  value="#{register.productDesc}" />
			</p:column>
			<p:column
				headerText="#{i18n['lbl.owner.agrarian_business_perspective.sub_product_crop']}">
				<p:inputText value="#{register.subProduct}" />
			</p:column>
			<p:column 
				headerText="#{i18n['lbl.owner.agrarian_business_perspective.sub_product_use']}">
				<p:inputText value="#{register.subProductUse}" />
			</p:column>
			<p:column
				headerText="#{i18n['lbl.owner.agrarian_business_perspective.membership_technical_assistance_programs']}">
				<p:selectOneMenu
					value="#{register.membershipTechnicalAssistancePrograms}" id="radioAssistance" onchange="block(this);">
					<f:selectItem itemLabel="#{i18n['cmpnt.yes']}" itemValue="1" />
					<f:selectItem itemLabel="#{i18n['cmpnt.not']}" itemValue="2" />
				</p:selectOneMenu>
			</p:column>
			<p:column
				headerText="#{i18n['lbl.owner.agrarian_business_perspective.assistance_program']}">
				<p:inputText value="#{register.assistanceProgram}" id="program" disabled="true"/>
			</p:column>
			<p:column
				headerText="#{i18n['lbl.owner.agrarian_business_perspective.assistance_entity']}">
				<p:inputText value="#{register.assistanceEntity}" id="entity" disabled="true"/>
			</p:column>
		</p:dataTable>
		<br />
		<br />		
		
		
	
	</h:form>
</h:body>
	
</html>